-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to choose a different email for notifications #28422
Conversation
6ede3a0
to
2e49000
Compare
4ae2959
to
51aefa3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool stuff and nice work 🎉
throw new InvalidArgumentException('Logged in user is not mail address owner'); | ||
} | ||
$email = $this->crypto->decrypt($key); | ||
$ref = \substr(hash('sha256', $email), 0, 8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason we limit it to the first 8 chars here? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I consider it sufficient to avoid collisions – this is just part of the configkey stored in the db and used to avoid collisions only. If you manage to craft a collision – mind it applies per user – you manage to overwrite a previously stored token. It could have a security implication, if you manage to create a token for a different user that fits the collision, and yet the payload still needs to be valid and pass the checks.
38a7645
to
c05a302
Compare
/backport to stable22 |
c05a302
to
1b7519f
Compare
1b7519f
to
0c4dcdd
Compare
apps/provisioning_api/lib/Controller/VerificationController.php
Outdated
Show resolved
Hide resolved
- to make it reusable - needed for local email verification Signed-off-by: Arthur Schiwon <[email protected]>
- mails added by (sub)admins are automatically verified - provisioning_api controller as verification endpoint - IAccountProperty gets a locallyVerified property - IPropertyCollection gets a method to fetch an IAccountProperty by value - an remove equivalent was already present - AccountManager always initiates mail verification on update if necessary - add core success template for arbitrary title and message Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
beb22ea
to
8c3553f
Compare
8c3553f
to
d378fc7
Compare
apps/provisioning_api/lib/Controller/VerificationController.php
Outdated
Show resolved
Hide resolved
d378fc7
to
763136a
Compare
- this is to avoid automatic confirmation by certain softwares that open links Signed-off-by: Arthur Schiwon <[email protected]>
- specific getters and setters on IUser and implementation - new notify_email field in provisioning API Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
- there will be times when it is necessary to reset this value for sure Signed-off-by: Arthur Schiwon <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comprehensive 👌
Getting and setting primary mail via provisioning API
curl -u $userid -X PUT -d 'key=notify_email' -d 'value=myname%40mydomain.com' -H 'OCS-APIRequest: true' https://my.nxt.cld/ocs/v2.php/cloud/users/$userid
(mind the address must be added as additional email address and also be confirmed)
curl -u $userid -X GET -H 'OCS-APIRequest: true' https://nc.zara/master/ocs/v2.php/cloud/users/$userid